/* Setup Rounting For All Pages */
angular.module('app.routes', ["ui.router", "oc.lazyLoad"])
    .config(['$ocLazyLoadProvider', '$stateProvider', '$urlRouterProvider', function($ocLazyLoadProvider, $stateProvider, $urlRouterProvider) {
        var staic_root = sysConfigs.sdir + "/admin/views";
        // Redirect any unmatched url
        if (sysConfigs.loginUser) {
            $urlRouterProvider.otherwise("/home.html");
        }
        // var timeStamp = function() {
        //     return ((new Date()).getTime());
        // };
        $stateProvider
            .state('home', {
                url: "/home.html",
                templateUrl: staic_root + "/home.html",
                data: {
                    pageTitle: '管理中心首页'
                },
                controller: "homeCtrl",
            })
            .state('GgcmsAdsList', {
                url: "/GgcmsAdsList.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsAdsList.html',
                data: {
                    pageTitle: '广告管理'
                },
                controller: "GgcmsAdsListCtrl",
            })
            .state('GgcmsAdsAdd', {
                url: "/GgcmsAdsAdd.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsAdsAdd.html',
                data: {
                    pageTitle: '广告编辑'
                },
                controller: "GgcmsAdsAddCtrl",
            })
            .state('GgcmsAssessList', {
                url: "/GgcmsAssessList.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsAssessList.html',
                data: {
                    pageTitle: '用户评价管理'
                },
                controller: "GgcmsAssessListCtrl",
            })
            .state('GgcmsArticleList', {
                url: "/GgcmsArticleList.html?Companyid",
                cache: false,
                templateUrl: staic_root + '/GgcmsArticleList.html',
                data: {
                    pageTitle: '文章内容管理'
                },
                controller: "GgcmsArticleListCtrl",
            })
            .state('GgcmsArticleAdd', {
                url: "/GgcmsArticleAdd.html?Companyid",
                cache: false,
                templateUrl: staic_root + '/GgcmsArticleAdd.html',
                data: {
                    pageTitle: '文章内容编辑'
                },
                controller: "GgcmsArticleAddCtrl",
            })
            .state('GgcmsCategoryList', {
                url: "/GgcmsCategoryList.html?userType&systype&Companyid",
                cache: false,
                templateUrl: staic_root + '/GgcmsCategoryList.html',
                data: {
                    pageTitle: '分类导航管理'
                },
                controller: "GgcmsCategoryListCtrl",
            })
            .state('GgcmsCategoryAdd', {
                url: "/GgcmsCategoryAdd.html?userType&systype&id&Companyid",
                cache: false,
                templateUrl: staic_root + '/GgcmsCategoryAdd.html',
                data: {
                    pageTitle: '分类导航信息设置'
                },
                controller: "GgcmsCategoryAddCtrl",
            })
            .state('GgcmsCompanyList', {
                url: "/GgcmsCompanyList.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsCompanyList.html',
                data: {
                    pageTitle: '企业信息管理'
                },
                controller: "GgcmsCompanyListCtrl",
            })
            .state('GgcmsCompanyAdd', {
                url: "/GgcmsCompanyAdd.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsCompanyAdd.html',
                data: {
                    pageTitle: '企业信息设置'
                },
                controller: "GgcmsCompanyAddCtrl",
            })
            .state('GgcmsExamRecordList', {
                url: "/GgcmsExamRecordList.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsExamRecordList.html',
                data: {
                    pageTitle: 'GgcmsExamRecord'
                },
                controller: "GgcmsExamRecordListCtrl",
            })
            .state('GgcmsExamRecordAdd', {
                url: "/GgcmsExamRecordAdd.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsExamRecordAdd.html',
                data: {
                    pageTitle: 'GgcmsExamRecord'
                },
                controller: "GgcmsExamRecordAddCtrl",
            })
            .state('GgcmsLearnRecordList', {
                url: "/GgcmsLearnRecordList.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsLearnRecordList.html',
                data: {
                    pageTitle: 'GgcmsLearnRecord'
                },
                controller: "GgcmsLearnRecordListCtrl",
            })
            .state('GgcmsLearnRecordAdd', {
                url: "/GgcmsLearnRecordAdd.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsLearnRecordAdd.html',
                data: {
                    pageTitle: 'GgcmsLearnRecord'
                },
                controller: "GgcmsLearnRecordAddCtrl",
            })
            .state('GgcmsQuestionsList', {
                url: "/GgcmsQuestionsList.html?ugroup",
                cache: false,
                templateUrl: staic_root + '/GgcmsQuestionsList.html',
                data: {
                    pageTitle: '试题管理'
                },
                controller: "GgcmsQuestionsListCtrl",
            })
            .state('GgcmsQuestionsAdd', {
                url: "/GgcmsQuestionsAdd.html?ugroup&id",
                cache: false,
                templateUrl: staic_root + '/GgcmsQuestionsAdd.html',
                data: {
                    pageTitle: '试题编辑'
                },
                controller: "GgcmsQuestionsAddCtrl",
            })
            .state('GgcmsSysdictsList', {
                url: "/GgcmsSysdictsList.html?group",
                cache: false,
                templateUrl: staic_root + '/GgcmsSysdictsList.html',
                data: {
                    pageTitle: '系统字典管理'
                },
                controller: "GgcmsSysdictsListCtrl",
            })
            .state('GgcmsSysdictsAdd', {
                url: "/GgcmsSysdictsAdd.html?group",
                cache: false,
                templateUrl: staic_root + '/GgcmsSysdictsAdd.html',
                data: {
                    pageTitle: 'GgcmsSysdicts'
                },
                controller: "GgcmsSysdictsAddCtrl",
            })
            .state('GgcmsTutorialList', {
                url: "/GgcmsTutorialList.html?ugroup",
                cache: false,
                templateUrl: staic_root + '/GgcmsTutorialList.html',
                data: {
                    pageTitle: '教程管理'
                },
                controller: "GgcmsTutorialListCtrl",
            })
            .state('GgcmsTutorialAdd', {
                url: "/GgcmsTutorialAdd.html?ugroup&id",
                cache: false,
                templateUrl: staic_root + '/GgcmsTutorialAdd.html',
                data: {
                    pageTitle: '教程编辑'
                },
                controller: "GgcmsTutorialAddCtrl",
            })
            .state('GgcmsUsersList', {
                url: "/GgcmsUsersList.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsUsersList.html',
                data: {
                    pageTitle: '用户管理'
                },
                controller: "GgcmsUsersListCtrl",
            })
            .state('GgcmsUsersAdd', {
                url: "/GgcmsUsersAdd.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsUsersAdd.html',
                data: {
                    pageTitle: '用户编辑'
                },
                controller: "GgcmsUsersAddCtrl",
            })
            .state('GgcmsMessagesList', {
                url: "/GgcmsMessagesList.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsMessagesList.html',
                data: {
                    pageTitle: '消息管理'
                },
                controller: "GgcmsMessagesListCtrl",
            })
            .state('GgcmsMessagesAdd', {
                url: "/GgcmsMessagesAdd.html",
                cache: false,
                templateUrl: staic_root + '/GgcmsMessagesAdd.html',
                data: {
                    pageTitle: '消息编辑'
                },
                controller: "GgcmsMessagesAddCtrl",
            });
    }]);